//
//  Cspace.h
//  SSE
//
//  Created by Matt Roman on 10/15/07.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "openGLheads.h"
#import "Crate.h"
#import "Point3.h"

#define CSPACE			0.4		// should be equal to the radius of the robot

@interface Cspace : NSObject {
	
	int ObjID;
	int color;
	int	spin;			// left is 1 right is 2
	bool spinLock;		// has both directions around the obstacle been checked?
	float radius;
	Point3f radPoint;
	Point3f center;
	NSMutableArray *VertexArray;		// an array of Point3 objects
}

// initializes a Cspace object with the rectangular section of a Crate object
- (id)initCspaceWithCrate:(Crate *)obst ID:(int)num;
// draws a Cspace object with any number of vertices
- (void)drawCspacePoint:(BOOL)pt RadLine:(BOOL)rad;
// sets the VertexArray of a Cspace object
- (void)setVertexArray:(NSMutableArray *)array;
// returns the pointer to the VertexArray of a Cspace object
- (NSMutableArray *)getVertexArray;
// returns a pointer to the center struct point of a Cspace object
- (Point3f *)getCenter;
- (void)setCenter:(Point3f)pt;
- (float)getRadius;
- (void)setRadius:(float)r;
- (void)setRadPoint:(Point3f)pt;
// returns YES if the point is inside the objects VertexArray, otherwise NO
- (BOOL)isPointInside:(Point3f *)pt;
- (int)getObjectNum;
- (void)setObjectNum:(int)num;
- (void)setColor:(int)c;
- (int)spin;
- (void)setSpin:(int)s;
- (bool)spinLock;
- (void)setSpinLock:(bool)sl;
- (void)dealloc;
@end
